package com.lineage.server.serverpackets;

import com.lineage.server.model.Instance.L1PcInstance;

public class S_ChatClanAlliance extends ServerBasePacket {
  private byte[] _byte = null;
  
  public S_ChatClanAlliance(L1PcInstance pc, String clanName, String chat) {
    buildPacket(pc, clanName, chat);
  }
  
  private void buildPacket(L1PcInstance pc, String clanName, String chat) {
    writeC(81);
    writeC(15);
    writeD(pc.isInvisble() ? 0 : pc.getId());
    writeS("[" + clanName + "][" + pc.getName() + "] " + chat);
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
